<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/28
 * Time: 0:08
 */

namespace Organize\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class OrganizeLogResources extends JsonResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'path' => $this->path,
            'method' => $this->method,
            'ip' => $this->ip,
            'input' => $this->input,
            'created_at' => $this->created_at->toDateTimeString(),
            'leader' => $this->whenLoaded('leader',(new LeaderResources($this->leader))),
        ];
    }
}